<template>
	<div>
		<catch-table :form-create="formCreate" v-bind="table" />
		<el-drawer title="推广信息中心" :visible.sync="drawer" size="55%">
			<div style="padding:40px;">
				<el-collapse v-model="activeNames" @change="handleChange">
					<el-collapse-item :title="'地址:'+item.address + '       店铺:'+ item.name + '--'+item.shop_no" name="1"
						v-for="(item,index) in tglist" :key="index" :name="index">

						<div style="background-color: aqua;margin-left: 40px;">
							<el-descriptions :column="2" border v-for="(s,i) in item.tg" :key="i">
								<el-descriptions-item>
									<template slot="label">
										<i class="el-icon-user"></i>
										店铺
									</template>
									地址:{{s.address }} 店铺:{{s.name }} --{{s.shop_no }}
								</el-descriptions-item>
								<el-descriptions-item>
									<template slot="label">
										<i class="el-icon-mobile-phone"></i>
										会员信息
									</template>
									**
								</el-descriptions-item>
							</el-descriptions>
						</div>
					</el-collapse-item>
				</el-collapse>
			</div>
		</el-drawer>


		<div v-if="codel==1">
			<el-drawer title="视频码记录" :visible.sync="drawer1">
				<!-- {{codedata.code}} - {{codedata.created_at}} -->
				<!-- {{codedata}} -->

				<el-table :data="codedata" style="width: 100%">
					<el-table-column prop="create_time" label="使用日期" width="180"> </el-table-column>
					<el-table-column prop="code" label="视频码" width="180"> </el-table-column>


				</el-table>
			</el-drawer>
		</div>

	</div>

</template>

<script>
	import renderTable from '@/views/render-table-form'

	export default {
		mixins: [renderTable],
		data() {
			return {
				tableFrom: '',
				drawer: false,
				activeNames: null,
				tglist: [],
				codel: 0,
				drawer1: false,
				codedata: {}
			}
		},
		methods: {
			// tongguo(e) {
			//   				this.$confirm('确定审核该门店生成门店信息吗?', '提示', {
			//   					confirmButtonText: '确认',
			//   					cancelButtonText: '点错了',
			//   					type: 'warning'
			//   				}).then(() => {

			//           this.$http.get('shenhe?id='+e.id).then(response => {
			//             this.formCreate.rule = response.data.form
			//           })


			//   				}).catch(() => {
			//   					this.$message({
			//   						type: 'info',
			//   						message: '已取消操作'
			//   					});
			//   				});


			// }
			codelist(e) {
				console.log(e)
				this.codel = 1
				this.drawer1 = true
				this.$http.get("shop/codelist?shopid=" + e.shop_no).then(r => {
					console.log(r)
					this.codedata = r.data

				})
			},
			zidingyi(e) {
				console.log(e)
				this.drawer = true
				this.$http.get('shop/cxtg?shopid=' + e.shop_no).then(r => {
					this.tglist = r.data
				})
			},
			handleChange(val) {
				console.log(val);
			},
		}
	}

	// beforeSubmit(row) {
	//   if (row.form.parent_id instanceof Array) {
	//     row.form.parent_id = row.form.parent_id.length > 0 ? row.form.parent_id.pop() : 0
	//   }
	//   return row
	// },
	// zidingyi(e) {
	//   console.log(e)
	// }
</script>

<style>
	.el-descriptions--small.is-bordered .el-descriptions-item__cell {
		/* padding: 8px 10px; */
		width: 10px;
	}
</style>